package com.loe.test

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.loe.ktui.MATCH_PARENT
import com.loe.ktui.custom.ui_RefreshLayout
import com.loe.ktui.ui_LinearLayout
import com.loe.ktui.ui_ScrollView
import com.loe.ktui.ui_Text
import com.loe.ktui.util.KtColor
import kotlinx.android.synthetic.main.activity_test_refresh.*

class TestRefreshActivity : AppCompatActivity()
{
    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_test_refresh)

        rootView.initUI()
        {
            ui_RefreshLayout()
            {
                width = MATCH_PARENT
                refreshTextColor = KtColor.red

                onRefresh()
                {
                    rootView.postDelayed({
                        loadOk()
                    }, 500)
                }

                ui_ScrollView()
                {
                    width = MATCH_PARENT

                    ui_LinearLayout()
                    {
                        width = MATCH_PARENT
                        paddingH = 15

                        ui_Text()
                        {
                            text = "上课的晶方科技水电费肯德基哈萨克对方几乎是快捷方式的接口"
                            paddingV = 50
                        }
                        ui_Text()
                        {
                            text = "k山东科技防水等级开发是的是的"
                            paddingV = 50
                        }
                        ui_Text()
                        {
                            text = "dgdfgdff都发给对方"
                            paddingV = 50
                        }
                        ui_Text()
                        {
                            text = "怪怪的发鬼地方放电饭锅电饭锅都发给对方个"
                            paddingV = 50
                        }
                        ui_Text()
                        {
                            text = "给个大概的发"
                            paddingV = 50
                        }
                        ui_Text()
                        {
                            text = "腹股沟管过过过过过过过过过过过过过过过过过茶多酚更"
                            paddingV = 50
                        }
                        ui_Text()
                        {
                            text = "怪怪的发鬼地方放电饭锅电饭锅都发给对方个"
                            paddingV = 50
                        }
                        ui_Text()
                        {
                            text = "给个大概的发"
                            paddingV = 50
                        }
                        ui_Text()
                        {
                            text = "腹股沟管过过过过过过过过过过过过过过过过过茶多酚更"
                            paddingV = 50
                        }
                        ui_Text()
                        {
                            text = "给个大概的发"
                            paddingV = 50
                        }
                        ui_Text()
                        {
                            text = "腹股沟管过过过过过过过过过过过过过过过过过茶多酚更"
                            paddingV = 50
                        }
                    }
                }
            }
        }
    }
}